package com.xbongbong.pro.enums.global;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author
 * @create 2020-06-19 20:19
 * @Description
 */
@Getter
public enum ChartCategoryEnum {

    /**
     * corpid为0的默认配置
     */
    SALES_REPORT("salesReport", "table.chartCategory.name.sales_report"),

    ANNOUNCEMENT("announcement", "table.chartCategory.name.announcement"),

    APPROVAL("approval", "table.chartCategory.name.approval"),

    APPROVAL_PROGRESS("approvalProgress", "table.chartCategory.name.approval_progress"),

    COMMUNICATE_PLAN("communicatePlan", "table.chartCategory.name.communicate_plan"),

    REMIND("remind", "table.chartCategory.name.remind"),

    FORGET_REMIND("forgetRemind", "table.chartCategory.name.forget_remind"),

    STOCK_WARNING("stockWarning", "table.chartCategory.name.stock_warning"),

    CUSTOMER_CARE("customerCare", "table.chartCategory.name.customer_care"),

    KEFU("kefu", "table.chartCategory.name.kefu"),

    REPORT_BOARD("reportBoard", "table.chartCategory.name.report_board"),

    PK("pk", "table.chartCategory.name.pk"),

    PERFORMANCE("performance", "table.chartCategory.name.performance"),

    CUSTOMER("customer", "table.chartCategory.name.customer"),

    OPPORTUNITY("opportunity", "table.chartCategory.name.opportunity"),

    CONTRACT("contract", "table.chartCategory.name.contract"),

    PURCHASE("purchase", "table.chartCategory.name.purchase"),

    WORK_ORDER("workOrder", "table.chartCategory.name.work_order"),

    CUSTOMER_ANALYSIS("customerAnalysis", "table.chartCategory.name.customer_analysis"),

    CUSTOMER_TOTAL_CHART("customerTotalChart", "table.chartCategory.name.customer_total_chart"),

    CUSTOMER_ACTIVE_CHART_MONTH("customerActiveChartMonth", "table.chartCategory.name.customer_active_chart_month"),

    CUSTOMER_ACTIVE_CHART_DAY("customerActiveChartDay", "table.chartCategory.name.customer_active_chart_day"),

    CUSTOMER_ADD_CHART("customerAddChart", "table.chartCategory.name.customer_add_chart"),

    CUSTOMER_OK_CHART_CONVERSION("customerOkChartConversion", "table.chartCategory.name.customer_ok_chart_conversion"),

    CUSTOMER_PORTRAIT("customerPortrait", "table.chartCategory.name.customer_portrait"),

    CUSTOMER_TABLE_CHART("customerTableChart", "table.chartCategory.name.customer_table_chart"),

    CUSTOMER_FUNNEL_CHART("customerFunnelChart", "table.chartCategory.name.customer_funnel_chart"),

    SALES_BEHAVIOR_ANALYSIS("salesBehaviorAnalysis", "table.chartCategory.name.sales_behavior_analysis"),

    COMMUNICATE_ADD_CHART("communicateAddChart", "table.chartCategory.name.communicate_add_chart"),

    COMMUNICATE_TYPE_CHART("communicateTypeChart", "table.chartCategory.name.communicate_type_chart"),

    CUSTOMER_FOLLOW_CHART_MAP("customerFollowChartMap", "table.chartCategory.name.customer_follow_chart_map"),

    CUSTOMER_FOLLOW_CHART_COMPARED("customerFollowChartCompared", "table.chartCategory.name.customer_follow_chart_compared"),

    CUSTOMER_LOSE_ANALYSIS("customerLoseAnalysis", "table.chartCategory.name.customer_lose_analysis"),

    OPPORTUNITY_ANALYSIS("opportunityAnalysis", "table.chartCategory.name.opportunity_analysis"),

    OPPORTUNITY_FUNNEL_CHART("opportunityFunnelChart", "table.chartCategory.name.opportunity_funnel_chart"),

    OPPORTUNITY_TREND_CHART("opportunityTrendChart", "table.chartCategory.name.opportunity_trend_chart"),

    OPPORTUNITY_TREND_CHART_PREDICT("opportunityTrendChartPredict", "table.chartCategory.name.opportunity_trend_chart_predict"),

    OPPORTUNITY_WIN_RATE_CHART("opportunityWinRateChart", "table.chartCategory.name.opportunity_win_rate_chart"),

    OPPORTUNITY_MAP_CHART("opportunityMapChart", "table.chartCategory.name.opportunity_map_chart"),

    OPPORTUNITY_LOSE_CAUSE_CHART("opportunityLoseCauseChart", "table.chartCategory.name.opportunity_lose_cause_chart"),

    CONTRACT_RETURN_ANALYSIS("contractReturnAnalysis", "table.chartCategory.name.contract_return_analysis"),

    CONTRACT_COUNT_CHART("contractCountChart", "table.chartCategory.name.contract_count_chart"),

    CONTRACT_AMOUNT_CHART("contractAmountChart", "table.chartCategory.name.contract_amount_chart"),

    RED_CONTRACT_CHART("redContractChart", "table.chartCategory.name.red_contract_chart"),

    RED_REFUND_REASON_CHART("redRefundReasonChart", "table.chartCategory.name.red_refund_reason_chart"),

    CUSTOMER_AMOUNT_LEADER_BOARD("customerAmountLeaderboard", "table.chartCategory.name.customer_amount_leader_board"),

    CONTRACT_SUMMARY_CHART("contractSummaryChart", "table.chartCategory.name.contract_summary_chart"),

    WORK_ORDER_ANALYSIS("workOrderAnalysis", "table.chartCategory.name.work_order_analysis"),

    WORK_ORDER_TOTAL_CHART("workOrderTotalChart", "table.chartCategory.name.work_order_total_chart"),

    WORK_ORDER_ADD_CHART("workOrderAddChart", "table.chartCategory.name.work_order_add_chart"),

    WORK_ORDER_CLOSE_CHART("workOrderCloseChart", "table.chartCategory.name.work_order_close_chart"),

    WORK_ORDER_FINISH_CHART("workOrderFinishChart", "table.chartCategory.name.work_order_finish_chart"),

    WORK_ORDER_FINISH_DELAY_CHART("workOrderFinishDelayChart", "table.chartCategory.name.work_order_finish_delay_chart"),

    WORK_ORDER_FINISH_INTIME_CHART("workOrderFinishIntimeChart", "table.chartCategory.name.work_order_finish_intime_chart"),

    WORK_ORDER_DEGREE_CHART("workOrderDegreeChart", "table.chartCategory.name.work_order_degree_chart"),

    WORK_ORDER_FINISH_TIME_CHART("workOrderFinishTimeChart", "table.chartCategory.name.work_order_finish_time_chart"),

    WORK_ORDER_PRICE_CHART("workOrderPriceChart", "table.chartCategory.name.work_order_price_chart"),

    PRODUCT_SALES_ANALYSIS("productSalesAnalysis", "table.chartCategory.name.product_sales_analysis"),

    PRODUCT_TABLE_CHART("productTableChart", "table.chartCategory.name.product_table_chart"),

    PRODUCT_SALES_MAP_CHART("productSalesMapChart", "table.chartCategory.name.product_sales_map_chart"),

    PRODUCT_CATEGORY_RATE_CHART("productCategoryRateChart", "table.chartCategory.name.product_category_rate_chart"),

    PRODUCT_SALES_CHART("productSalesChart", "table.chartCategory.name.product_sales_chart"),

    RED_REFUND_PRODUCT_CHART("redRefundProductChart", "table.chartCategory.name.red_refund_product_chart"),

    PROCUREMENT_ANALYSIS("procurementAnalysis", "table.chartCategory.name.procurement_analysis"),

    PURCHASE_TABLE_CHART("purchaseTableChart", "table.chartCategory.name.purchase_table_chart"),

    PURCHASE_SUPPLIER("purchaseSupplier", "table.chartCategory.name.purchase_supplier"),

    INVENTORY_ANALYSIS("inventoryAnalysis", "table.chartCategory.name.inventory_analysis"),

    STOCK_TABLE_CHART("stockTableChart", "table.chartCategory.name.stock_table_chart"),

    STOCK_PRODUCT_CHART("stockProductChart", "table.chartCategory.name.stock_product_chart"),

    PK_USER("pkUser", "table.chartCategory.name.pk_user"),

    PK_USER_CONTRACT_AMOUNT("pkUserContractAmount", "table.chartCategory.name.pk_user_contract_amount"),

    PK_USER_PAYMENT_ED("pkUserPaymentEd", "table.chartCategory.name.pk_user_payment_ed"),

    PK_USER_CONTRACT_COUNT("pkUserContractCount", "table.chartCategory.name.pk_user_contract_count"),

    PK_USER_PRODUCT_SALES("pkUserProductSales", "table.chartCategory.name.pk_user_product_sales"),

    PK_USER_CUSTOMER_ADD("pkUserCustomerAdd", "table.chartCategory.name.pk_user_customer_add"),

    PK_USER_CONTACT_ADD("pkUserContactAdd", "table.chartCategory.name.pk_user_contact_add"),

    PK_USER_COMMUNICATE_ADD("pkUserCommunicateAdd", "table.chartCategory.name.pk_user_communicate_add"),

    PK_USER_OPPORTUNITY_ADD_COUNT("pkUserOpportunityAddCount", "table.chartCategory.name.pk_user_opportunity_add_count"),

    PK_USER_OPPORTUNITY_ADD_AMOUNT("pkUserOpportunityAddAmount", "table.chartCategory.name.pk_user_opportunity_add_amount"),

    PK_USER_CUSTOMER_FOLLOW("pkUserCustomerFollow", "table.chartCategory.name.pk_user_customer_follow"),

    PK_USER_CONTRACT_PROFIT("pkUserContractProfit", "table.chartCategory.name.pk_user_contract_profit"),

    PROFIT_ANALYSIS("profitAnalysis", "table.chartCategory.name.profit_analysis"),

    CONTRACT_PROFIT_CHART("contractProfitChart", "table.chartCategory.name.contract_profit_chart"),

    CONTRACT_PROFIT_CHART_CASH("contractProfitChartCash", "table.chartCategory.name.contract_profit_chart_cash"),

    PRODUCT_PROFIT_CHART("productProfitChart", "table.chartCategory.name.product_profit_chart"),

    PRODUCTION_ANALYSIS("productionAnalysis", "table.chartCategory.name.production_analysis"),

    PRODUCTION_ORDER_ADD_CHART("productionOrderAddChart", "table.chartCategory.name.production_order_add_chart"),

    PRODUCTION_ORDER_COMPLETE_CHART("productionOrderCompleteChart", "table.chartCategory.name.production_order_complete_chart"),

    PRODUCTION_ORDER_FINISHED_CHART("productionOrderFinishedChart", "table.chartCategory.name.production_order_finished_chart"),

    PERFORMANCE_FINISH_CHART("performanceFinishChart", "table.chartCategory.name.performance_finish_chart"),
    
    SYSTEM_PERFORMANCE_CHART("systemPerformanceChart", "table.chartCategory.name.systemPerformanceChart"),

    CALL_STATISTICS("callStatistics", "table.chartCategory.name.call_statistics"),

    INBOUND("inbound", "table.chartCategory.name.inbound"),

    OUTBOUND("outbound", "table.chartCategory.name.outbound"),

    STAFF_INBOUND("staffInbound", "table.chartCategory.name.staffInbound"),

    STAFF_OUTBOUND("staffOutbound", "table.chartCategory.name.staffOutbound"),

    PENDING_WORK_ORDER("pendingWorkOrder", "table.chartCategory.name.pending_work_order"),

    PENDING_WORK_ORDER_V2("pendingWorkOrderV2", "table.chartCategory.name.pending_work_order_v2"),

    QUOTATION("quotation", "table.chartCategory.name.quotation"),

    QUOTATION_ANALYSIS("quotationAnalysis", "table.chartCategory.name.quotation_analysis"),

    QUOTATION_COUNT_CHART("quotationCountChart", "table.chartCategory.name.quotation_count_chart"),

    QUOTATION_AMOUNT_CHART("quotationAmountChart", "table.chartCategory.name.quotation_amount_chart"),

    QUOTATION_CONVERSION_CHART("quotationConversionChart", "table.chartCategory.name.quotation_conversion_chart"),

    PK_USER_QUOTATION_COUNT("pkUserQuotationCount", "table.chartCategory.name.pk_user_quotation_count"),

    PK_USER_QUOTATION_AMOUNT("pkUserQuotationAmount", "table.chartCategory.name.pk_user_quotation_amount"),

    PK_USER_QUOTATION_CONVERSION("pkUserQuotationConversion", "table.chartCategory.name.pk_user_quotation_conversion"),

    RAIDERS("raiders", "table.chartCategory.name.raiders"),

    FUND_ANALYSIS("fundAnalysis", "table.chartCategory.name.fund_analysis"),

    FUND_MANAGEMENT("fundManagement", "table.chartCategory.name.fund_management"),

    INCOME_AND_EXPENDITURE("incomeAndExpenditure", "table.chartCategory.name.income_and_expenditure"),

    PAYMENT_ANALYSIS("paymentAnalysis", "table.chartCategory.name.payment_analysis"),

    PAY_ANALYSIS("payAnalysis", "table.chartCategory.name.pay_analysis"),

    INVOICE_ANALYSIS("invoiceAnalysis", "table.chartCategory.name.invoice_analysis"),

    DATA_WARNING("dataWarning", "table.chartCategory.name.data_warning"),
    ;

    private String alias;

    private String name;

    ChartCategoryEnum(String alias, String name) {
        this.alias = alias;
        this.name = name;
    }

    public static ChartCategoryEnum getByAlias(String alias) {
        for (ChartCategoryEnum chartCategoryEnum : values()) {
            if (Objects.equals(alias, chartCategoryEnum.getAlias())) {
                return chartCategoryEnum;
            }
        }
        return null;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }
}
